/*
 * @描述:  柱状图
 * @Author: /songzi
 * @Date: 2019-08-19 09:36:41
 * @Last Modified by:   songzi
 * @Last Modified time: 2019-08-19 09:36:41
 */

import React, { PureComponent, Fragment } from 'react';
import DataSet from '@antv/data-set';
import { Chart, Geom, Axis, Tooltip, Legend, Coord, Guide, Line } from 'bizcharts';

class Stackedcolumn extends PureComponent {
  constructor(props) {
    super(props);
  }

  render() {
    const { data } = this.props;
    return (
      <Fragment>
        <Legend />
        <Axis name="dataTime" />
        <Axis
          name="value"
          label={{
            formatter: val => `${val}次`,
          }}
        />
        <Geom
          type="intervalStack"
          position="dataTime*value"
          style={{
            stroke: '#fff',
            lineWidth: 1,
          }}
          size={30}
          //   size={[
          //     'value',
          //     count => {
          //       console.log(count);
          //       if (count > 100) return 180;
          //       return 20;
          //     },
          //   ]}
          color={['$network_type', '#f44336-#9c27b0-#2196f3-#ffc107']}
        />
      </Fragment>
    );
  }
}

export default Stackedcolumn;
